<?php
/**
 * Created by PhpStorm.
 * User: dolia
 * Date: 15/12/3
 * Time: 下午4:46
 */

namespace App\Interfaces;

use App\Coupon;

interface CartService
{


    /**
     * 获取购物车商品
     * @param string $userId
     * @param string $session_id
     * @return mixed  包含: 1.每个商品小计字段 2.每个商品关税
     */
    public function getCartGoods();
    //清空购物车
    public function deleteCartGoods(array $goods_ids=[]);
    /**
     * 添加上品到购物车
     * @param $goods_id
     * @param $goods_number
     * @return mixed
     */
    public function addGoods($goods_id,$goods_number);
    /**
     *修改商品数量到购物车
     */
    public function updateGoods($goods_id,$goods_number);
    /**
     * 绑定购物卷
     * @param Coupon $coupon
     * @return mixed
     *
     */
    public function bindCoupon(Coupon $coupon);
    /**
     * 删除购物车中某个商品
     * @param $goods_id
     * @return mixed
     */
    public function removeGoods(Array $goods_ids);



    /**
     * 获取购物车详情
     * @param array $goods_id
     * @return mixed 1. 总价,总个数,总关税
     */

    //public function getInfo(Array $cartGoods, $sel_id);
    public function getInfo(Array $goods_ids=[]);

    /**
     * 游客用户转化为登陆用户
     * @param $session_id
     * @param $user_id
     * @return mixed
     */
    public function linkSessionToUser($session_id,$user_id);



    /**
     * 获取商品数组中商品总数、总价、总关税等信息
     * @param array $cartGoods :已选中商品数组array(0=>array('goods_id'=>1, 'goods_num'=>2), 1=>array('goods_id'=>2, 'goods_num'=>2))
     * @return mixed 1. 总价,总个数,总关税
     */
    public function getGoodsInfo($cartGoods);//end func getGoodsInfo

    /**
     * @return mixed
     * 得到购物车商品种类数量
     */
    public function  getCartNumber();
}